#!/usr/bin/env python
# -*- encoding: utf-8 -*-

"""
@File : base.py
@Author : Braylon1002
@Version : 1.0
@Contact : S.Braylon1002@gmail.com
Desc : None
"""

from abc import ABC, abstractmethod
from transformers import Column
from transformers.columnFlow import ColumnFlow

class BaseFeature(ABC):
    """
    base class for feature column classes
    """
    @abstractmethod
    def __init__(self, name, column_flow=None):
        """
        __init__
        :param name: str
            name of the feature
        :param column_flow: ColumnFlow or list of col transformers
            transform the data
        """
        self.name = name
        self.column_flow = None

        if column_flow:
            if isinstance(column_flow, ColumnFlow):
                self.column_flow = column_flow
            elif isinstance(column_flow, list):
                self.column_flow = ColumnFlow(column_flow)
            elif isinstance(column_flow, Column):
                self.column_flow = ColumnFlow([column_flow])
            else:
                raise NotImplementedError(
                    "wrong input type with ColumnFlow"
                )

